import { createApp } from 'vue'
import App from './App.vue'
//引入路由
import router from '@/router'
import 'element-plus/dist/index.css';

import common from './utils/common'
import constant from './utils/constant'

//引入element-plus插件
import ElementPlus from 'element-plus'

import pinia from '@/store'

import VueLazyload from 'vue-lazyload';
import '@/assets/styles/themes.css'

import '@element-plus/icons-vue'


import './assets/css/animation.css'
import './assets/css/index.css'
import './assets/css/tocbot.css'
import './assets/css/color.css'
import './assets/css/markdown-highlight.css'
import './assets/css/font-awesome.min.css'
import 'mavon-editor/dist/css/index.css'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'



const app = createApp(App)


const eventBus = app.provide('eventBus', {
  // 在这里定义事件和方法
  message: '',
  setMessage(message:any) {
    this.message = message;
  }
});


for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }

// 添加全局属性，方法和变量
app.config.globalProperties.$common = common;
app.config.globalProperties.$constant = constant;

app.use(ElementPlus)
app.use(pinia)
app.use(VueLazyload)


app.use(router)




app.mount('#app')

